package com.dgw.elasticsearch.entity;

import org.elasticsearch.common.xcontent.XContent;
import org.elasticsearch.common.xcontent.XContentType;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Mapping;

/**
 * @program: springboot-elasticsearch
 * @description:
 * @author: Mr.Dai
 * @create: 2020-02-27 22:36
 **/
// indexName: 索引名称  type: 执行数据库类型的表
@Document(indexName = "esadmin",type = "admin")
@Mapping(mappingPath = "admin_es.json") //指向映射文件
public class Admin {

    @Id
    private Long id;
    private String username;
    private String password;
    private String loveThings;

    public Admin(Long id, String username, String password, String loveThings) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.loveThings = loveThings;
    }

    public Admin() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getLoveThings() {
        return loveThings;
    }

    public void setLoveThings(String loveThings) {
        loveThings = loveThings;
    }

    @Override
    public String toString() {
        return "Admin{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", LoveThings='" + loveThings + '\'' +
                '}';
    }
}
